package com.cyd.service;

import com.cyd.spring.CydApplicationContext;

/**
 * @version 1.0.0
 * Created by cyd on 2024-07-31 10:18:34
 * @ClassName : com.cyd.service.Test
 * @Description : 类描述
 */
public class MyApplication {
    public static void main(String[] args) {
        CydApplicationContext applicationContext = new CydApplicationContext(AppConfig.class);
        System.out.println(MyApplication.class.getSimpleName() + "--------------");
        System.out.println(applicationContext.getBean("userService"));
        System.out.println(applicationContext.getBean("userService"));
        System.out.println(applicationContext.getBean("userService"));

        IUserService userService = (IUserService) applicationContext.getBean("userService");

        System.out.println(MyApplication.class.getSimpleName() + "--------------" + userService);
        userService.test();

        // 验证@PostConstruct
        System.out.println(userService.getAdmin());
    }
}
